package aishua.com.mytestapplist.hencoder;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by aishua on 2018/1/4.
 */

public class HenCoderDrawCirlceView extends View {

    private static final String TAG = "HenCoderDrawCirlceView-";
    private Paint paint;
    public HenCoderDrawCirlceView(Context context) {
        super(context);
        init();
    }

    public HenCoderDrawCirlceView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public HenCoderDrawCirlceView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }
    private void init(){
        paint = new Paint();
    }
    @Override
    protected void onDraw(Canvas canvas) {

        super.onDraw(canvas);
        paint.setColor(Color.RED);
        canvas.drawCircle(300,300,200,paint);
        drawHollowcircle(canvas);


    }
    public void drawHollowcircle(Canvas canvas){

        paint.setColor(Color.BLACK);
        paint.setStyle(Paint.Style.STROKE);
        paint.setAntiAlias(true);
        paint.setStrokeWidth(50);
        canvas.drawCircle(800,300,150,paint);
    }

}
